// 封装组织架构请求

import request from '@/utils/request'

// 导出
export function getDepartments() {
  return request(
    {
      url: '/company/department'
    }
  )
}

// 封装删除 接口
export function delPartments(id) {
  return request(
    {
      url: `/company/department/${id}`,
      method: 'delete'
    }
  )
}

// 封装新增接口
//
export function addPartments(data) {
  return request(
    {
      url: `/company/department`,
      method: 'post',
      data
    }
  )
}

// 封装获取部门接口
// export function editPartments(id) {
//   return request(
//     {
//       url: `/company/department/${id}`
//     }
//   )
// }

export function editPartments(data) {
  return request(
    {
      url: `/company/department/${data.id}`
    }
  )
}

// 封装编辑部门
export function updateDepartments(data) {
  return request(
    {
      url: `/company/department/${data.id}`,
      method: 'put',
      data
    }
  )
}
